package com.example.calculator_backend.pojo;

import java.math.BigDecimal;

/**
 * @description: 每月还款详情
 * @author: hdr
 * @PACKAGE_NAME: com.example.calculator_backend.pojo
 * @DATE: 2025/8/11
 */
public class PaymentDetail {
    private int monthIndex;           // 月份索引
    private BigDecimal principal;     // 本金
    private BigDecimal interest;      // 利息
    private BigDecimal totalPayment;  // 总还款
    private BigDecimal remainingPrincipal; // 剩余本金

    // 构造函数
    public PaymentDetail() {}

    public PaymentDetail(int monthIndex, BigDecimal principal, BigDecimal interest, BigDecimal totalPayment, BigDecimal remainingPrincipal) {
        this.monthIndex = monthIndex;
        this.principal = principal;
        this.interest = interest;
        this.totalPayment = totalPayment;
        this.remainingPrincipal = remainingPrincipal;
    }

    // Getter 和 Setter 方法
    public int getMonthIndex() {
        return monthIndex;
    }

    public void setMonthIndex(int monthIndex) {
        this.monthIndex = monthIndex;
    }

    public BigDecimal getPrincipal() {
        return principal;
    }

    public void setPrincipal(BigDecimal principal) {
        this.principal = principal;
    }

    public BigDecimal getInterest() {
        return interest;
    }

    public void setInterest(BigDecimal interest) {
        this.interest = interest;
    }

    public BigDecimal getTotalPayment() {
        return totalPayment;
    }

    public void setTotalPayment(BigDecimal totalPayment) {
        this.totalPayment = totalPayment;
    }

    public BigDecimal getRemainingPrincipal() {
        return remainingPrincipal;
    }

    public void setRemainingPrincipal(BigDecimal remainingPrincipal) {
        this.remainingPrincipal = remainingPrincipal;
    }

    @Override
    public String toString() {
        return "PaymentDetail{" +
                "monthIndex=" + monthIndex +
                ", principal=" + principal +
                ", interest=" + interest +
                ", totalPayment=" + totalPayment +
                ", remainingPrincipal=" + remainingPrincipal +
                '}';
    }
}
